home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / AppInit.3 < prev    next >
Encoding:
Text File  |  1994-12-17  |  1.9 KB  |  56 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) AppInit.3 1.3 94/12/17 16:17:06
  9. '\" 
  10. .so man.macros
  11. .HS Tcl_AppInit tclc 7.0
  12. .BS
  13. .SH NAME
  14. Tcl_AppInit \- Perform application-specific initialization
  15. .SH SYNOPSIS
  16. .nf
  17. \fB#include <tcl.h>\fR
  18. .sp
  19. \fBTcl_AppInit\fR(\fIinterp\fR)
  20. .SH ARGUMENTS
  21. .AS Tcl_Interp *interp
  22. .AP Tcl_Interp *interp in
  23. Interpreter for the application.
  24. .BE
  25.  
  26. .SH DESCRIPTION
  27. .PP
  28. \fBTcl_AppInit\fR is a procedure that is invoked by the main programs
  29. for Tcl applications such as \fBtclsh\fR and \fBwish\fR.
  30. Its purpose is to allow new Tcl applications to be created without
  31. modifying existing main programs such as those for \fBtclsh\fR
  32. and \fBwish\fR.
  33. To create a new application simply write a new version of
  34. \fBTcl_AppInit\fR to replace the default version provided by Tcl,
  35. then link your new \fBTcl_AppInit\fR with the Tcl library, which
  36. contains the main program from \fBtclsh\fR (be sure to specify the
  37. switch ``\fB\-u _main\fR'' to the linker to force it to use the
  38. version of \fBmain\fR from the Tcl library).
  39. .PP
  40. \fBTcl_AppInit\fR is invoked after other initialization in
  41. \fBmain\fR and before entering the main loop to process commands.
  42. Here are some examples of things that \fBTcl_AppInit\fR might do:
  43. .IP [1]
  44. Call initialization procedures for various packages used by
  45. the application.
  46. Each initialization procedure adds new commands to \fIinterp\fR
  47. for its package and performs other package-specific initialization.
  48. .IP [2]
  49. Process command-line arguments, which can be accessed from the
  50. Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
  51. .IP [3]
  52. Invoke a startup script to initialize the application.
  53.  
  54. .SH KEYWORDS
  55. application, argument, command, initialization, interpreter
  56.